//
//  SelectableCategorySystem.cpp
//  QuizMaster
//
//  Created by Jeppe Nielsen on 4/9/15.
//  Copyright (c) 2015 Jeppe Nielsen. All rights reserved.
//

#include "SelectableCategorySystem.hpp"


void SelectableCategorySystem::Initialize() {
    AddComponent<Transform>();
    AddComponent<SelectableCategory>();
}

SelectableCategorySystem::Categories SelectableCategorySystem::GetActiveCategories() {
    Categories categories;
    
    for (ObjectCollection::const_iterator it = Objects().begin(); it!=Objects().end(); ++it) {
        GameObject* object = *it;
        Transform* transform = object->GetComponent<Transform>();
        SelectableCategory* category = object->GetComponent<SelectableCategory>();
        if (transform->Position().x>0) {
            categories.push_back(category->category);
        }
    }
    
    return categories;
}